import request from '@/utils/request'

// 项目立项, 项目分配, 项目数据, 项目变更列表
export function listProject(query) {
  return request({
    url: '/supervise/proInfoApi/selectListByDataPermission',
    method: 'post',
    params: query
  })
}

// 项目编号
export function getCode(query) {
  return request({
    url: `/supervise/proInfoApi/getCode`,
    method: 'post',
    params: query
  })
}

// 项目无权限
export function listNoProject(query) {
  return request({
    url: '/supervise/proInfoApi/listNoPermission',
    method: 'post',
    params: query
  })
}

// 删除项目
export function deleteProject(id) {
  return request({
    url: '/supervise/proInfoApi/remove',
    method: 'post',
    params: { id }
  })
}

// 新增项目
export function addProject(data) {
  return request({
    url: '/supervise/proInfoApi/add',
    method: 'post',
    data: data
  })
}

// 更新项目
export function updateProject(data) {
  return request({
    url: '/supervise/proInfoApi/update',
    method: 'post',
    data: data
  })
}

// 项目详情
export function getProjectById(id) {
  return request({
    url: '/supervise/proInfoApi/get/' + id
  })
}

// 修改项目状态
export function changeStatus(data) {
  return request({
    url: '/supervise/proInfoApi/changeStatus',
    method: 'post',
    params: data
  })
}

// 项目供应商单位
export function enterpriseApi(data) {
  return request({
    url: '/supervise/supperTypeApi/listNoPermission',
    method: 'post',
    params: data
  })
}

// 项目附件
export function getAttachment(id) {
  return request({
    url: '/supervise/proInfoApi/getAttachment/' + id
  })
}

// 已分配设备接口
export function getAllocatedDevices(proId) {
  return request({
    url: '/supervise/proEquipmentApi/listByProId',
    method: 'post',
    params: { proId }
  })
}
// 建筑物接口
export function getBuilding(proId) {
  return request({
    url: '/supervise/buildApi/listByProId',
    method: 'post',
    params: { proId }
  })
}

// 基本信息接口
export function getBasicInfo(id) {
  return request({
    url: '/supervise/proInfoApi/getNoPermission/' + id
  })
}
// 已分配人员接口
export function getAssignedPersonnel(proId) {
  return request({
    url: '/supervise/userApi/listByProId',
    method: 'post',
    params: { proId }
  })
}
// 勘探点信息接口
export function getExplorationPoint(proId) {
  return request({
    url: '/supervise/explorationApi/listByProId',
    method: 'post',
    params: { proId }
  })
}
// 供应商接口
export function getSupplier(proId) {
  return request({
    url: '/supervise/enterpriseApi/listByProId',
    method: 'post',
    params: { proId }
  })
}
